package org.theonept.travian.model;

import java.util.Arrays;

public enum EnumRace {
	GERMAIN("nation2"), ROMAIN("nation1"), GAULOIS("nation3");
	private String idRace;

	private EnumRace(String idRace) {
		this.setIdRace(idRace);
	}

	public static EnumRace getRaceFromId(String id) {
		for (EnumRace race : Arrays.asList(EnumRace.values())) {
			if (id.contains(race.getIdRace())) {
				return race;
			}
		}
		return null;

	}

	public String getIdRace() {
		return idRace;
	}

	public void setIdRace(String idRace) {
		this.idRace = idRace;
	}
}
